package models;

import java.util.List;
import javax.persistence.Entity;
import play.db.jpa.Model;

@Entity
public class NodeConfig extends Model {
    private String nodeIP;

    public NodeConfig(String nodeIP) {
        super();
        this.nodeIP = nodeIP;
    }

    public String getNodeIP() {
        return nodeIP;
    }

    public void setNodeIP(String nodeIP) {
        this.nodeIP = nodeIP;
    }

    public static List<String> getNodes() {
        return find("SELECT c.nodeIP FROM NodeConfig c GROUP BY c.nodeIP").fetch();
    }   
    
    @Override
    public String toString() {
        return "NodeConfig [nodeIP=" + nodeIP + "]";
    }
}